import request from '@/utils/request';

export async function getBopTotalByPage(params: any) {
  return request('/api/design/getBopTotalByPage', {
    method: 'POST',
    data: params,
  });
}

export async function addBop(params: any) {
  return request('/api/design/addBop', {
    method: 'POST',
    data: params,
  });
}

export async function updateBop(params: any) {
  return request('/api/design/updateBop', {
    method: 'POST',
    data: params,
  });
}

export async function delBopTotal(params: any) {
  return request('/api/design/delBopTotal', {
    method: 'POST',
    data: params,
  });
}

export async function exportBopTotal(params: any) {
  return request('/api/design/exportBopTotal', {
    method: 'POST',
    data: params,
    responseType: 'blob',
  });
}

export async function getAllProcess(params: any) {
  return request('/api/design/getAllProcess', {
    method: 'POST',
    data: params,
  });
}

// 通过工艺路径id获取工序
export async function getBopTotalById(para: any) {
  return request('/api/design/getBopTotalById', {
    method: 'POST',
    requestType: 'form',
    params: {
      id: para.id,
    },
  });
}

export default { getBopTotalByPage, addBop, updateBop, delBopTotal, exportBopTotal };
